/************************************
 * created by Tonk (tonk@ctonk.com) *
 ************************************/

// functions.cpp

#include "definitions.h"
#include <iostream>
#include "functions.h"
#include "stringutil.h"

void sendToRoom( int roomNumber, const char* text ) {
	std::string message = text;
	message << "\n\r";
	Room* room = World::Instance().FindRoom( roomNumber );

	for ( int i=0; i < (int)room->GetClist().size(); i++ )
		room->GetC( i )->Send( message );

	return;
}

void sendToRoom( int roomNumber, char* text ) {
	std::string message = text;
	message << "\n\r";
	Room* room = World::Instance().FindRoom( roomNumber );

	for ( int i=0; i < (int)room->GetClist().size(); i++ )
		room->GetC( i )->Send( message );

	return;
}

void sendToRoom( int roomNumber, std::string& text ) {
	std::string message = text;
	message << "\n\r";
	Room* room = World::Instance().FindRoom( roomNumber );

	for ( int i=0; i < (int)room->GetClist().size(); i++ )
		room->GetC( i )->Send( message );

	return;
}

void sendToRoom( Room* room, const char* text ) {
	std::string message = text;
	message << "\n\r";

	for ( int i=0; i < (int)room->GetClist().size(); i++ )
		room->GetC( i )->Send( message );

	return;
}

void sendToRoom( Room* room, char* text ) {
	std::string message = text;
	message << "\n\r";

	for ( int i=0; i < (int)room->GetClist().size(); i++ )
		room->GetC( i )->Send( message );

	return;
}

void sendToRoom( Room* room, std::string& text ) {
	std::string message = text;
	message << "\n\r";

	for ( int i=0; i < (int)room->GetClist().size(); i++ )
		room->GetC( i )->Send( message );

	return;
}
